package com.android.sunflower.logic.room

import androidx.room.Room
import com.android.sunflower.ui.MainActivity

//饿汉单例模式实现的数据库对象
class DBSingleton private constructor(){
    companion object{
        private val instance=Room.databaseBuilder(MainActivity.runningInstance?.applicationContext!!,AppDataBase::class.java,"sfAppDB").build()
        fun getInstance()=instance
    }

}